<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>后台管理系统</title>
<js href="__PUBLIC__/Js/Jquery/jquery-1.4.4.min.js" />
<link href="../Public/admin/css/golbal.css" rel="stylesheet" type="text/css" />
<link href="../Public/admin/css/picture.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
function gopage(nowpage){
		if(nowpage=='')nowpage=1;
		var totalpage=parseInt("<?php echo $_SESSION['pagetotalPages'];?>");

		if(parseInt(nowpage)==nowpage)
		{
			if(nowpage<=0)
			{
				alert('请输入大于0的整数页码!');
				return false;
			}
			else if(nowpage>totalpage)
			{
				alert('请输入小于最大分页数的整数页码!');
				return false;
			}
		}
		else
		{
			alert('请输入大于0的整数页码!');
			return false;
		}
		var obj=location.href;
		var url=obj.substring(0,obj.indexOf("?")+1);
		var paraString=obj.substring(obj.indexOf("?")+1,obj.length).split("&");
		url="<?php echo $_SESSION['pageurl'];?>";
		url+="&p="+nowpage;
		window.location=url;
	}
</script>
</head>

<body>
<div class="tittle">
<span>气象网管理中心—-视频回收站</span>
</div>

<div class="infor">
<form action="{:U('Recover/video')}" method="get">
<img src="../Public/admin/images/zoom.jpg" />
<p>
<input id="searTxt" name="searkey" type="text" <eq name='search' value='1'>class="cBlack" value="{$key}"<else/>class="cGray" value="请输入搜索关键字"</eq>/>
</p>
<input class="sear" type="submit" value="搜索" />
</form>
</div>

<div class="detab">
<table cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr class="thi">
<th width="70">编号</th>
<th width="209">标题</th>
<th width="110">上传时间</th>
<th width="100">上传的用户</th>
<th width="105">下载所需积分</th>
<th width="102">点击下载次数</th>
<th width="100">操作</th>
</tr>
<empty name="list">
<tr>
	<td colspan="7" style="text-align:center;">
		<h3>对不起，没有符合要求的资源</h3>
	</td>
</tr>
<else />
<volist id="vo" name="list">
<tr>
<td>{$vo.code}</td>
<td>{$vo.title|msubstr=###,0,8}</td>
<td>{$vo.uploadtime|date="Y-m-d",###}</td>
<td>{$vo.nickname}</td>
<td>{$vo.downscore}</td>
<td>{$vo.point}</td>
<td class="last_bt"><a href="javascript:void(0);" onclick="recover({$vo['vid']},'Video','vid');" class="recover">还原</a><a href="javascript:void(0);" onclick="dele({$vo['vid']},'Video','vid');" class="move">删除</a></td>
</tr>
</volist>
</empty>
</tbody>
</table>
</div>

<div class="num">
{$page}
</div>
<div class="clear"></div>

<script type="text/javascript">
//搜索框
$(function(){
	$("#searTxt").focus(function() {
		if($("#searTxt").val() == '请输入搜索关键字'){
			$("#searTxt").val("");
		}
		$("#searTxt").removeClass("cGray");
		$("#searTxt").addClass("cBlack");
	});
	$("#searTxt").blur(function() {
		if($("#searTxt").val() == ''){
			$("#searTxt").val("请输入搜索关键字");
			$("#searTxt").removeClass("cBlack");
			$("#searTxt").addClass("cGray");
		}
	});
});

//还原资源
function recover(pid,model,key){
	pid = pid;
	model = model;
	key = key;
	pid = pid.toString();
	if(pid == '' || model == '' || !confirm('确定要还原该资源？')) return false;
	$.post("{:U('Recover/recover')}", {pid:pid,model:model,key:key}, function(res){
		if(res == '1') location.href = location.href;
		else alert('还原失败');
	});
}

//删除资源
function dele(pid,model,key){
	pid = pid;
	model = model;
	key = key;
	pid = pid.toString();
	if(pid == '' || model == '' || !confirm('确定要删除该资源？')) return false;
	$.post("{:U('Recover/delet')}", {pid:pid,model:model,key:key}, function(res){
		if(res == '1') location.href = location.href;
		else alert('删除失败');
	});
}
</script>
</body>
</html>
